﻿﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;
using UFIDA.U8.DB;

namespace UFIDA.U8.WAZH.NBBankSync
{
    /// <summary>
    /// 数据访问类:GL_accvouch
    /// </summary>
    public partial class GL_accvouch
    {
        public GL_accvouch()
        { }
        #region  BasicMethod

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static List<CommandInfo> GetInsertCommand(UFIDA.U8.DB.Model.GL_accvouch model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into GL_accvouch(");
            strSql.Append("iperiod,csign,isignseq,ino_id,inid,dbill_date,idoc,cbill,ccheck,cbook,ibook,ccashier,iflag,ctext1,ctext2,cdigest,ccode,cexch_name,md,mc,md_f,mc_f,nfrat,nd_s,nc_s,csettle,cn_id,dt_date,cdept_id,cperson_id,ccus_id,csup_id,citem_id,citem_class,cname,ccode_equal,iflagbank,iflagPerson,bdelete,coutaccset,ioutyear,coutsysname,coutsysver,doutbilldate,ioutperiod,coutsign,coutno_id,doutdate,coutbillsign,coutid,bvouchedit,bvouchAddordele,bvouchmoneyhold,bvalueedit,bcodeedit,ccodecontrol,bPCSedit,bDeptedit,bItemedit,bCusSupInput,cDefine1,cDefine2,cDefine3,cDefine4,cDefine5,cDefine6,cDefine7,cDefine8,cDefine9,cDefine10,cDefine11,cDefine12,cDefine13,cDefine14,cDefine15,cDefine16,dReceive,cWLDZFlag,dWLDZTime,bFlagOut,iBG_OverFlag,cBG_Auditor,dBG_AuditTime,cBG_AuditOpinion,bWH_BgFlag,ssxznum,CErrReason,BG_AuditRemark,cBudgetBuffer,iBG_ControlResult,NCVouchID,daudit_date,RowGuid,cBankReconNo,iyear,iYPeriod,wllqDate,wllqPeriod,tvouchtime,cblueoutno_id,ccodeexch_equal,cpzchcode)");
            strSql.Append(" values (");
            strSql.Append("@iperiod,@csign,@isignseq,@ino_id,@inid,@dbill_date,@idoc,@cbill,@ccheck,@cbook,@ibook,@ccashier,@iflag,@ctext1,@ctext2,@cdigest,@ccode,@cexch_name,@md,@mc,@md_f,@mc_f,@nfrat,@nd_s,@nc_s,@csettle,@cn_id,@dt_date,@cdept_id,@cperson_id,@ccus_id,@csup_id,@citem_id,@citem_class,@cname,@ccode_equal,@iflagbank,@iflagPerson,@bdelete,@coutaccset,@ioutyear,@coutsysname,@coutsysver,@doutbilldate,@ioutperiod,@coutsign,@coutno_id,@doutdate,@coutbillsign,@coutid,@bvouchedit,@bvouchAddordele,@bvouchmoneyhold,@bvalueedit,@bcodeedit,@ccodecontrol,@bPCSedit,@bDeptedit,@bItemedit,@bCusSupInput,@cDefine1,@cDefine2,@cDefine3,@cDefine4,@cDefine5,@cDefine6,@cDefine7,@cDefine8,@cDefine9,@cDefine10,@cDefine11,@cDefine12,@cDefine13,@cDefine14,@cDefine15,@cDefine16,@dReceive,@cWLDZFlag,@dWLDZTime,@bFlagOut,@iBG_OverFlag,@cBG_Auditor,@dBG_AuditTime,@cBG_AuditOpinion,@bWH_BgFlag,@ssxznum,@CErrReason,@BG_AuditRemark,@cBudgetBuffer,@iBG_ControlResult,@NCVouchID,@daudit_date,@RowGuid,@cBankReconNo,@iyear,@iYPeriod,@wllqDate,@wllqPeriod,@tvouchtime,@cblueoutno_id,@ccodeexch_equal,@cpzchcode)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@iperiod", SqlDbType.TinyInt,1),
					new SqlParameter("@csign", SqlDbType.NVarChar,8),
					new SqlParameter("@isignseq", SqlDbType.Int,4),
					new SqlParameter("@ino_id", SqlDbType.SmallInt,2),
					new SqlParameter("@inid", SqlDbType.SmallInt,2),
					new SqlParameter("@dbill_date", SqlDbType.DateTime),
					new SqlParameter("@idoc", SqlDbType.SmallInt,2),
					new SqlParameter("@cbill", SqlDbType.NVarChar,20),
					new SqlParameter("@ccheck", SqlDbType.NVarChar,20),
					new SqlParameter("@cbook", SqlDbType.NVarChar,20),
					new SqlParameter("@ibook", SqlDbType.TinyInt,1),
					new SqlParameter("@ccashier", SqlDbType.NVarChar,20),
					new SqlParameter("@iflag", SqlDbType.TinyInt,1),
					new SqlParameter("@ctext1", SqlDbType.NVarChar,10),
					new SqlParameter("@ctext2", SqlDbType.NVarChar,10),
					new SqlParameter("@cdigest", SqlDbType.NVarChar,120),
					new SqlParameter("@ccode", SqlDbType.NVarChar,40),
					new SqlParameter("@cexch_name", SqlDbType.NVarChar,8),
					new SqlParameter("@md", SqlDbType.Money,8),
					new SqlParameter("@mc", SqlDbType.Money,8),
					new SqlParameter("@md_f", SqlDbType.Money,8),
					new SqlParameter("@mc_f", SqlDbType.Money,8),
					new SqlParameter("@nfrat", SqlDbType.Float,8),
					new SqlParameter("@nd_s", SqlDbType.Float,8),
					new SqlParameter("@nc_s", SqlDbType.Float,8),
					new SqlParameter("@csettle", SqlDbType.NVarChar,3),
					new SqlParameter("@cn_id", SqlDbType.NVarChar,30),
					new SqlParameter("@dt_date", SqlDbType.DateTime),
					new SqlParameter("@cdept_id", SqlDbType.NVarChar,12),
					new SqlParameter("@cperson_id", SqlDbType.NVarChar,20),
					new SqlParameter("@ccus_id", SqlDbType.NVarChar,20),
					new SqlParameter("@csup_id", SqlDbType.NVarChar,20),
					new SqlParameter("@citem_id", SqlDbType.NVarChar,60),
					new SqlParameter("@citem_class", SqlDbType.NVarChar,2),
					new SqlParameter("@cname", SqlDbType.NVarChar,40),
					new SqlParameter("@ccode_equal", SqlDbType.NVarChar,50),
					new SqlParameter("@iflagbank", SqlDbType.TinyInt,1),
					new SqlParameter("@iflagPerson", SqlDbType.TinyInt,1),
					new SqlParameter("@bdelete", SqlDbType.Bit,1),
					new SqlParameter("@coutaccset", SqlDbType.NVarChar,3),
					new SqlParameter("@ioutyear", SqlDbType.SmallInt,2),
					new SqlParameter("@coutsysname", SqlDbType.NVarChar,10),
					new SqlParameter("@coutsysver", SqlDbType.NVarChar,10),
					new SqlParameter("@doutbilldate", SqlDbType.DateTime),
					new SqlParameter("@ioutperiod", SqlDbType.TinyInt,1),
					new SqlParameter("@coutsign", SqlDbType.NVarChar,100),
					new SqlParameter("@coutno_id", SqlDbType.NVarChar,50),
					new SqlParameter("@doutdate", SqlDbType.DateTime),
					new SqlParameter("@coutbillsign", SqlDbType.NVarChar,100),
					new SqlParameter("@coutid", SqlDbType.NVarChar,50),
					new SqlParameter("@bvouchedit", SqlDbType.Bit,1),
					new SqlParameter("@bvouchAddordele", SqlDbType.Bit,1),
					new SqlParameter("@bvouchmoneyhold", SqlDbType.Bit,1),
					new SqlParameter("@bvalueedit", SqlDbType.Bit,1),
					new SqlParameter("@bcodeedit", SqlDbType.Bit,1),
					new SqlParameter("@ccodecontrol", SqlDbType.NVarChar,50),
					new SqlParameter("@bPCSedit", SqlDbType.Bit,1),
					new SqlParameter("@bDeptedit", SqlDbType.Bit,1),
					new SqlParameter("@bItemedit", SqlDbType.Bit,1),
					new SqlParameter("@bCusSupInput", SqlDbType.Bit,1),
					new SqlParameter("@cDefine1", SqlDbType.NVarChar,20),
					new SqlParameter("@cDefine2", SqlDbType.NVarChar,20),
					new SqlParameter("@cDefine3", SqlDbType.NVarChar,20),
					new SqlParameter("@cDefine4", SqlDbType.DateTime),
					new SqlParameter("@cDefine5", SqlDbType.Int,4),
					new SqlParameter("@cDefine6", SqlDbType.DateTime),
					new SqlParameter("@cDefine7", SqlDbType.Float,8),
					new SqlParameter("@cDefine8", SqlDbType.NVarChar,4),
					new SqlParameter("@cDefine9", SqlDbType.NVarChar,8),
					new SqlParameter("@cDefine10", SqlDbType.NVarChar,60),
					new SqlParameter("@cDefine11", SqlDbType.NVarChar,120),
					new SqlParameter("@cDefine12", SqlDbType.NVarChar,120),
					new SqlParameter("@cDefine13", SqlDbType.NVarChar,120),
					new SqlParameter("@cDefine14", SqlDbType.NVarChar,120),
					new SqlParameter("@cDefine15", SqlDbType.Int,4),
					new SqlParameter("@cDefine16", SqlDbType.Float,8),
					new SqlParameter("@dReceive", SqlDbType.DateTime),
					new SqlParameter("@cWLDZFlag", SqlDbType.NVarChar,1),
					new SqlParameter("@dWLDZTime", SqlDbType.DateTime),
					new SqlParameter("@bFlagOut", SqlDbType.Bit,1),
					new SqlParameter("@iBG_OverFlag", SqlDbType.Int,4),
					new SqlParameter("@cBG_Auditor", SqlDbType.NVarChar,40),
					new SqlParameter("@dBG_AuditTime", SqlDbType.DateTime),
					new SqlParameter("@cBG_AuditOpinion", SqlDbType.NVarChar,50),
					new SqlParameter("@bWH_BgFlag", SqlDbType.Bit,1),
					new SqlParameter("@ssxznum", SqlDbType.Int,4),
					new SqlParameter("@CErrReason", SqlDbType.NVarChar,512),
					new SqlParameter("@BG_AuditRemark", SqlDbType.NVarChar,512),
					new SqlParameter("@cBudgetBuffer", SqlDbType.NVarChar,10),
					new SqlParameter("@iBG_ControlResult", SqlDbType.SmallInt,2),
					new SqlParameter("@NCVouchID", SqlDbType.NVarChar,60),
					new SqlParameter("@daudit_date", SqlDbType.DateTime),
					new SqlParameter("@RowGuid", SqlDbType.VarChar,60),
					new SqlParameter("@cBankReconNo", SqlDbType.NVarChar,30),
					new SqlParameter("@iyear", SqlDbType.SmallInt,2),
					new SqlParameter("@iYPeriod", SqlDbType.Int,4),
					new SqlParameter("@wllqDate", SqlDbType.DateTime),
					new SqlParameter("@wllqPeriod", SqlDbType.Int,4),
					new SqlParameter("@tvouchtime", SqlDbType.DateTime),
					new SqlParameter("@cblueoutno_id", SqlDbType.NVarChar,50),
					new SqlParameter("@ccodeexch_equal", SqlDbType.NVarChar,2000),
					new SqlParameter("@cpzchcode", SqlDbType.NVarChar,32)};
            parameters[0].Value = model.iperiod;
            parameters[1].Value = model.csign;
            parameters[2].Value = model.isignseq;
            parameters[3].Value = model.ino_id;
            parameters[4].Value = model.inid;
            parameters[5].Value = model.dbill_date;
            parameters[6].Value = model.idoc;
            parameters[7].Value = model.cbill;
            parameters[8].Value = model.ccheck;
            parameters[9].Value = model.cbook;
            parameters[10].Value = model.ibook;
            parameters[11].Value = model.ccashier;
            parameters[12].Value = model.iflag;
            parameters[13].Value = model.ctext1;
            parameters[14].Value = model.ctext2;
            parameters[15].Value = model.cdigest;
            parameters[16].Value = model.ccode;
            parameters[17].Value = model.cexch_name;
            parameters[18].Value = model.md;
            parameters[19].Value = model.mc;
            parameters[20].Value = model.md_f;
            parameters[21].Value = model.mc_f;
            parameters[22].Value = model.nfrat;
            parameters[23].Value = model.nd_s;
            parameters[24].Value = model.nc_s;
            parameters[25].Value = model.csettle;
            parameters[26].Value = model.cn_id;
            parameters[27].Value = model.dt_date;
            parameters[28].Value = model.cdept_id;
            parameters[29].Value = model.cperson_id;
            parameters[30].Value = model.ccus_id;
            parameters[31].Value = model.csup_id;
            parameters[32].Value = model.citem_id;
            parameters[33].Value = model.citem_class;
            parameters[34].Value = model.cname;
            parameters[35].Value = model.ccode_equal;
            parameters[36].Value = model.iflagbank;
            parameters[37].Value = model.iflagPerson;
            parameters[38].Value = model.bdelete;
            parameters[39].Value = model.coutaccset;
            parameters[40].Value = model.ioutyear;
            parameters[41].Value = model.coutsysname;
            parameters[42].Value = model.coutsysver;
            parameters[43].Value = model.doutbilldate;
            parameters[44].Value = model.ioutperiod;
            parameters[45].Value = model.coutsign;
            parameters[46].Value = model.coutno_id;
            parameters[47].Value = model.doutdate;
            parameters[48].Value = model.coutbillsign;
            parameters[49].Value = model.coutid;
            parameters[50].Value = model.bvouchedit;
            parameters[51].Value = model.bvouchaddordele;
            parameters[52].Value = model.bvouchmoneyhold;
            parameters[53].Value = model.bvalueedit;
            parameters[54].Value = model.bcodeedit;
            parameters[55].Value = model.ccodecontrol;
            parameters[56].Value = model.bPCSedit;
            parameters[57].Value = model.bDeptedit;
            parameters[58].Value = model.bItemedit;
            parameters[59].Value = model.bCusSupInput;
            parameters[60].Value = model.cDefine1;
            parameters[61].Value = model.cDefine2;
            parameters[62].Value = model.cDefine3;
            parameters[63].Value = model.cDefine4;
            parameters[64].Value = model.cDefine5;
            parameters[65].Value = model.cDefine6;
            parameters[66].Value = model.cDefine7;
            parameters[67].Value = model.cDefine8;
            parameters[68].Value = model.cDefine9;
            parameters[69].Value = model.cDefine10;
            parameters[70].Value = model.cDefine11;
            parameters[71].Value = model.cDefine12;
            parameters[72].Value = model.cDefine13;
            parameters[73].Value = model.cDefine14;
            parameters[74].Value = model.cDefine15;
            parameters[75].Value = model.cDefine16;
            parameters[76].Value = model.dReceive;
            parameters[77].Value = model.cWLDZFlag;
            parameters[78].Value = model.dWLDZTime;
            parameters[79].Value = model.bFlagOut;
            parameters[80].Value = model.iBG_OverFlag;
            parameters[81].Value = model.cBG_Auditor;
            parameters[82].Value = model.dBG_AuditTime;
            parameters[83].Value = model.cBG_AuditOpinion;
            parameters[84].Value = model.bWH_BgFlag;
            parameters[85].Value = model.ssxznum;
            parameters[86].Value = model.CErrReason;
            parameters[87].Value = model.BG_AuditRemark;
            parameters[88].Value = model.cBudgetBuffer;
            parameters[89].Value = model.iBG_ControlResult;
            parameters[90].Value = model.NCVouchID;
            parameters[91].Value = model.daudit_date;
            parameters[92].Value = model.RowGuid;
            parameters[93].Value = model.cBankReconNo;
            parameters[94].Value = model.iyear;
            parameters[95].Value = model.iYPeriod;
            parameters[96].Value = model.wllqDate;
            parameters[97].Value = model.wllqPeriod;
            parameters[98].Value = model.tvouchtime;
            parameters[99].Value = model.cblueoutno_id;
            parameters[100].Value = model.ccodeexch_equal;
            parameters[101].Value = model.cpzchcode;

            List<CommandInfo> cmdList = new List<CommandInfo>();
            CommandInfo cmd = new CommandInfo(strSql.ToString(), parameters);
            cmdList.Add(cmd);

            if (model.CashItem != null && !string.IsNullOrEmpty(model.CashItem.cCashItem))
            {
                cmd = GL_CashTable.GetAddCommand(model.CashItem);
                cmdList.Add(cmd);
            }

            return cmdList;
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static List<CommandInfo> GetInsertCommand(UFIDA.U8.DB.Model.GL_accvouch model, string TableName)
        {
            //StringBuilder strSql = new StringBuilder();
            //strSql.Append("insert into " + TableName + "(");
            //strSql.Append("csign,ino_id,inid,cbill,doutbilldate,ccashier,idoc,ctext1,ctext2,cexch_name,cdigest,ccode,md,mc,md_f,mc_f,nfrat,nd_s,nc_s,csettle,cn_id,dt_date,cdept_id,cperson_id,ccus_id,csup_id,citem_id,citem_class,cname,ccode_equal,bvouchedit,bvouchaddordele,bvouchmoneyhold,bvalueedit,bcodeedit,ccodecontrol,bPCSedit,bDeptedit,bItemedit,bCusSupInput,coutaccset,ioutyear,coutsysname,coutsysver,ioutperiod,coutsign,coutno_id,doutdate,coutbillsign,coutid,iflag,cDefine1,cDefine2,cDefine3,cDefine4,cDefine5,cDefine6,cDefine7,cDefine8,cDefine9,cDefine10,cDefine11,cDefine12,cDefine13,cDefine14,cDefine15,cDefine16,iBG_ControlResult,daudit_date,cblueoutno_id,ccashitem_id)");
            //strSql.Append(" values (");
            //strSql.Append("@csign,@ino_id,@inid,@cbill,@doutbilldate,@ccashier,@idoc,@ctext1,@ctext2,@cexch_name,@cdigest,@ccode,@md,@mc,@md_f,@mc_f,@nfrat,@nd_s,@nc_s,@csettle,@cn_id,@dt_date,@cdept_id,@cperson_id,@ccus_id,@csup_id,@citem_id,@citem_class,@cname,@ccode_equal,@bvouchedit,@bvouchaddordele,@bvouchmoneyhold,@bvalueedit,@bcodeedit,@ccodecontrol,@bPCSedit,@bDeptedit,@bItemedit,@bCusSupInput,@coutaccset,@ioutyear,@coutsysname,@coutsysver,@ioutperiod,@coutsign,@coutno_id,@doutdate,@coutbillsign,@coutid,@iflag,@cDefine1,@cDefine2,@cDefine3,@cDefine4,@cDefine5,@cDefine6,@cDefine7,@cDefine8,@cDefine9,@cDefine10,@cDefine11,@cDefine12,@cDefine13,@cDefine14,@cDefine15,@cDefine16,@iBG_ControlResult,@daudit_date,@cblueoutno_id,@ccashitem_id)");
            //SqlParameter[] parameters = {
            //        new SqlParameter("@csign", SqlDbType.NVarChar,28),
            //        new SqlParameter("@ino_id", SqlDbType.SmallInt,2),
            //        new SqlParameter("@inid", SqlDbType.SmallInt,2),
            //        new SqlParameter("@cbill", SqlDbType.NVarChar,80),
            //        new SqlParameter("@doutbilldate", SqlDbType.DateTime),
            //        new SqlParameter("@ccashier", SqlDbType.NVarChar,80),
            //        new SqlParameter("@idoc", SqlDbType.SmallInt,2),
            //        new SqlParameter("@ctext1", SqlDbType.NVarChar,50),
            //        new SqlParameter("@ctext2", SqlDbType.NVarChar,50),
            //        new SqlParameter("@cexch_name", SqlDbType.NVarChar,28),
            //        new SqlParameter("@cdigest", SqlDbType.NVarChar,120),
            //        new SqlParameter("@ccode", SqlDbType.NVarChar,40),
            //        new SqlParameter("@md", SqlDbType.Money,8),
            //        new SqlParameter("@mc", SqlDbType.Money,8),
            //        new SqlParameter("@md_f", SqlDbType.Money,8),
            //        new SqlParameter("@mc_f", SqlDbType.Money,8),
            //        new SqlParameter("@nfrat", SqlDbType.Float,8),
            //        new SqlParameter("@nd_s", SqlDbType.Float,8),
            //        new SqlParameter("@nc_s", SqlDbType.Float,8),
            //        new SqlParameter("@csettle", SqlDbType.NVarChar,23),
            //        new SqlParameter("@cn_id", SqlDbType.NVarChar,30),
            //        new SqlParameter("@dt_date", SqlDbType.DateTime),
            //        new SqlParameter("@cdept_id", SqlDbType.NVarChar,12),
            //        new SqlParameter("@cperson_id", SqlDbType.NVarChar,80),
            //        new SqlParameter("@ccus_id", SqlDbType.NVarChar,80),
            //        new SqlParameter("@csup_id", SqlDbType.NVarChar,20),
            //        new SqlParameter("@citem_id", SqlDbType.NVarChar,80),
            //        new SqlParameter("@citem_class", SqlDbType.NVarChar,22),
            //        new SqlParameter("@cname", SqlDbType.NVarChar,40),
            //        new SqlParameter("@ccode_equal", SqlDbType.NVarChar,50),
            //        new SqlParameter("@bvouchedit", SqlDbType.Bit,1),
            //        new SqlParameter("@bvouchaddordele", SqlDbType.Bit,1),
            //        new SqlParameter("@bvouchmoneyhold", SqlDbType.Bit,1),
            //        new SqlParameter("@bvalueedit", SqlDbType.Bit,1),
            //        new SqlParameter("@bcodeedit", SqlDbType.Bit,1),
            //        new SqlParameter("@ccodecontrol", SqlDbType.NVarChar,50),
            //        new SqlParameter("@bPCSedit", SqlDbType.Bit,1),
            //        new SqlParameter("@bDeptedit", SqlDbType.Bit,1),
            //        new SqlParameter("@bItemedit", SqlDbType.Bit,1),
            //        new SqlParameter("@bCusSupInput", SqlDbType.Bit,1),
            //        new SqlParameter("@coutaccset", SqlDbType.NVarChar,23),
            //        new SqlParameter("@ioutyear", SqlDbType.SmallInt,2),
            //        new SqlParameter("@coutsysname", SqlDbType.NVarChar,50),
            //        new SqlParameter("@coutsysver", SqlDbType.NVarChar,50),
            //        new SqlParameter("@ioutperiod", SqlDbType.TinyInt,1),
            //        new SqlParameter("@coutsign", SqlDbType.NVarChar,80),
            //        new SqlParameter("@coutno_id", SqlDbType.NVarChar,100),
            //        new SqlParameter("@doutdate", SqlDbType.DateTime),
            //        new SqlParameter("@coutbillsign", SqlDbType.NVarChar,80),
            //        new SqlParameter("@coutid", SqlDbType.NVarChar,50),
            //        new SqlParameter("@iflag", SqlDbType.TinyInt,1),
            //        new SqlParameter("@cDefine1", SqlDbType.NVarChar,20),
            //        new SqlParameter("@cDefine2", SqlDbType.NVarChar,20),
            //        new SqlParameter("@cDefine3", SqlDbType.NVarChar,20),
            //        new SqlParameter("@cDefine4", SqlDbType.DateTime),
            //        new SqlParameter("@cDefine5", SqlDbType.Int,4),
            //        new SqlParameter("@cDefine6", SqlDbType.DateTime),
            //        new SqlParameter("@cDefine7", SqlDbType.Float,8),
            //        new SqlParameter("@cDefine8", SqlDbType.NVarChar,4),
            //        new SqlParameter("@cDefine9", SqlDbType.NVarChar,8),
            //        new SqlParameter("@cDefine10", SqlDbType.NVarChar,60),
            //        new SqlParameter("@cDefine11", SqlDbType.NVarChar,120),
            //        new SqlParameter("@cDefine12", SqlDbType.NVarChar,120),
            //        new SqlParameter("@cDefine13", SqlDbType.NVarChar,120),
            //        new SqlParameter("@cDefine14", SqlDbType.NVarChar,120),
            //        new SqlParameter("@cDefine15", SqlDbType.Int,4),
            //        new SqlParameter("@cDefine16", SqlDbType.Float,8),
            //        new SqlParameter("@iBG_ControlResult", SqlDbType.SmallInt,2),
            //        new SqlParameter("@daudit_date", SqlDbType.DateTime),
            //        new SqlParameter("@cblueoutno_id", SqlDbType.NVarChar,50),
            //        new SqlParameter("@ccashitem_id", SqlDbType.NVarChar,80)};
            //parameters[0].Value = model.csign;
            //parameters[1].Value = model.ino_id;
            //parameters[2].Value = model.inid;
            //parameters[3].Value = model.cbill;
            //parameters[4].Value = model.doutbilldate;
            //parameters[5].Value = model.ccashier;
            //parameters[6].Value = model.idoc;
            //parameters[7].Value = model.ctext1;
            //parameters[8].Value = model.ctext2;
            //parameters[9].Value = model.cexch_name;
            //parameters[10].Value = model.cdigest;
            //parameters[11].Value = model.ccode;
            //parameters[12].Value = model.md;
            //parameters[13].Value = model.mc;
            //parameters[14].Value = model.md_f;
            //parameters[15].Value = model.mc_f;
            //parameters[16].Value = model.nfrat;
            //parameters[17].Value = model.nd_s;
            //parameters[18].Value = model.nc_s;
            //parameters[19].Value = model.csettle;
            //parameters[20].Value = model.cn_id;
            //parameters[21].Value = model.dt_date;
            //parameters[22].Value = model.cdept_id;
            //parameters[23].Value = model.cperson_id;
            //parameters[24].Value = model.ccus_id;
            //parameters[25].Value = model.csup_id;
            //parameters[26].Value = model.citem_id;
            //parameters[27].Value = model.citem_class;
            //parameters[28].Value = model.cname;
            //parameters[29].Value = model.ccode_equal;
            //parameters[30].Value = model.bvouchedit;
            //parameters[31].Value = model.bvouchaddordele;
            //parameters[32].Value = model.bvouchmoneyhold;
            //parameters[33].Value = model.bvalueedit;
            //parameters[34].Value = model.bcodeedit;
            //parameters[35].Value = model.ccodecontrol;
            //parameters[36].Value = model.bPCSedit;
            //parameters[37].Value = model.bDeptedit;
            //parameters[38].Value = model.bItemedit;
            //parameters[39].Value = model.bCusSupInput;
            //parameters[40].Value = model.coutaccset;
            //parameters[41].Value = model.ioutyear;
            //parameters[42].Value = model.coutsysname;
            //parameters[43].Value = model.coutsysver;
            //parameters[44].Value = model.ioutperiod;
            //parameters[45].Value = model.coutsign;
            //parameters[46].Value = model.coutno_id;
            //parameters[47].Value = model.doutdate;
            //parameters[48].Value = model.coutbillsign;
            //parameters[49].Value = model.coutid;
            //parameters[50].Value = model.iflag;
            //parameters[51].Value = model.cDefine1;
            //parameters[52].Value = model.cDefine2;
            //parameters[53].Value = model.cDefine3;
            //parameters[54].Value = model.cDefine4;
            //parameters[55].Value = model.cDefine5;
            //parameters[56].Value = model.cDefine6;
            //parameters[57].Value = model.cDefine7;
            //parameters[58].Value = model.cDefine8;
            //parameters[59].Value = model.cDefine9;
            //parameters[60].Value = model.cDefine10;
            //parameters[61].Value = model.cDefine11;
            //parameters[62].Value = model.cDefine12;
            //parameters[63].Value = model.cDefine13;
            //parameters[64].Value = model.cDefine14;
            //parameters[65].Value = model.cDefine15;
            //parameters[66].Value = model.cDefine16;
            //parameters[67].Value = model.iBG_ControlResult;
            //parameters[68].Value = model.daudit_date;
            //parameters[69].Value = model.cblueoutno_id;
            //parameters[70].Value = model.ccashitem_id;
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into " + TableName + "(");
            strSql.Append("csign,inid,cbill,cdigest,ccode,md,mc,cdept_id,cperson_id,ccus_id,csup_id,citem_id,citem_class,bvouchedit,bvouchaddordele,bvalueedit,bcodeedit,bDeptedit,bItemedit,bCusSupInput,coutaccset,ioutyear,coutsysname,coutsysver,ioutperiod,coutsign,coutno_id,ccashitem_id,dt_date, doutbilldate, cdefine10)");
            strSql.Append(" values (");
            strSql.Append("@csign,@inid,@cbill,@cdigest,@ccode,@md,@mc,@cdept_id,@cperson_id,@ccus_id,@csup_id,@citem_id,@citem_class,@bvouchedit,@bvouchaddordele,@bvalueedit,@bcodeedit,@bDeptedit,@bItemedit,@bCusSupInput,@coutaccset,@ioutyear,@coutsysname,@coutsysver,@ioutperiod,@coutsign,@coutno_id,@ccashitem_id,@dt_date, @doutbilldate, @cdefine10)");
            SqlParameter[] parameters = {
					new SqlParameter("@csign", SqlDbType.NVarChar,28),
					new SqlParameter("@inid", SqlDbType.SmallInt,2),
					new SqlParameter("@cbill", SqlDbType.NVarChar,80),
					new SqlParameter("@cdigest", SqlDbType.NVarChar,120),
					new SqlParameter("@ccode", SqlDbType.NVarChar,40),
					new SqlParameter("@md", SqlDbType.Money,8),
					new SqlParameter("@mc", SqlDbType.Money,8),
					new SqlParameter("@cdept_id", SqlDbType.NVarChar,12),
					new SqlParameter("@cperson_id", SqlDbType.NVarChar,80),
					new SqlParameter("@ccus_id", SqlDbType.NVarChar,80),
					new SqlParameter("@csup_id", SqlDbType.NVarChar,20),
					new SqlParameter("@citem_id", SqlDbType.NVarChar,80),
					new SqlParameter("@citem_class", SqlDbType.NVarChar,22),
					new SqlParameter("@bvouchedit", SqlDbType.Bit,1),
					new SqlParameter("@bvouchaddordele", SqlDbType.Bit,1),
					new SqlParameter("@bvalueedit", SqlDbType.Bit,1),
					new SqlParameter("@bcodeedit", SqlDbType.Bit,1),
					new SqlParameter("@bDeptedit", SqlDbType.Bit,1),
					new SqlParameter("@bItemedit", SqlDbType.Bit,1),
					new SqlParameter("@bCusSupInput", SqlDbType.Bit,1),
					new SqlParameter("@coutaccset", SqlDbType.NVarChar,23),
					new SqlParameter("@ioutyear", SqlDbType.SmallInt,2),
					new SqlParameter("@coutsysname", SqlDbType.NVarChar,50),
					new SqlParameter("@coutsysver", SqlDbType.NVarChar,50),
					new SqlParameter("@ioutperiod", SqlDbType.TinyInt,1),
					new SqlParameter("@coutsign", SqlDbType.NVarChar,80),
					new SqlParameter("@coutno_id", SqlDbType.NVarChar,100),
					new SqlParameter("@ccashitem_id", SqlDbType.NVarChar,80),
                    new SqlParameter("@dt_date", SqlDbType.NVarChar,50),
					new SqlParameter("@doutbilldate", SqlDbType.NVarChar,50),
                    new SqlParameter("@cdefine10", SqlDbType.NVarChar,50)                  
                                        };
            parameters[0].Value = model.csign;
            parameters[1].Value = model.inid;
            parameters[2].Value = model.cbill;
            parameters[3].Value = model.cdigest;
            parameters[4].Value = model.ccode;
            parameters[5].Value = model.md;
            parameters[6].Value = model.mc;
            parameters[7].Value = model.cdept_id;
            parameters[8].Value = model.cperson_id;
            parameters[9].Value = model.ccus_id;
            parameters[10].Value = model.csup_id;
            parameters[11].Value = model.citem_id;
            parameters[12].Value = model.citem_class;
            parameters[13].Value = model.bvouchedit;
            parameters[14].Value = model.bvouchaddordele;
            parameters[15].Value = model.bvalueedit;
            parameters[16].Value = model.bcodeedit;
            parameters[17].Value = model.bDeptedit;
            parameters[18].Value = model.bItemedit;
            parameters[19].Value = model.bCusSupInput;
            parameters[20].Value = model.coutaccset;
            parameters[21].Value = model.ioutyear;
            parameters[22].Value = model.coutsysname;
            parameters[23].Value = model.coutsysver;
            parameters[24].Value = model.ioutperiod;
            parameters[25].Value = model.coutsign;
            parameters[26].Value = model.coutno_id;
            parameters[27].Value = model.ccashitem_id;
            parameters[28].Value = model.dt_date;
            parameters[29].Value = model.doutbilldate;
            parameters[30].Value = model.cDefine10;


            List<CommandInfo> cmdList = new List<CommandInfo>();
            CommandInfo cmd = new CommandInfo(strSql.ToString(), parameters);
            cmdList.Add(cmd);

            //if (model.CashItem != null && !string.IsNullOrEmpty(model.CashItem.cCashItem))
            //{
            //    cmd = GL_CashTable.GetAddCommand(model.CashItem);
            //    cmdList.Add(cmd);
            //}

            return cmdList;
        }

        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}

